/**
 * Student Class
 * Use to create a student object
 *
 *  @author John Thomason
 *  Date: Fall 2008
 *  Course: CS222
 *  Seminar: 6
 *  Assign: Final Exam Part B
 *
 */
public class Student extends Person {

//INSTANCE VARIABLES

    private int           numberOfClasses;
    private double        overallGpa;
    private School.Degree degreeSought;


//CONSTRUCTORS

    private Student (){} //No default student; must pass args
    /**
     * Student Constructor
     * @param name  Name of student
     * @param age   Age of student
     */
    public Student (String name, int age) {
        this(name, age, School.Degree.AAS);
    }
    /**
     * Student Constuctor
     * @param name      Name of student
     * @param age       Age of student
     * @param degree    Degree sought by student
     */
    public Student (String name, int age, School.Degree degree) {
        super(name, age);
        this.degreeSought = degree;
    }//Constructors


//REQUIRED METHODS

    /**
     * Build a detailed list a student attributes
     * @return  A string of detailed student attributes
     */
    public String personDetails () {
        return String.format("%s\n  Degree Sought: %s\n  GPA: %.2f" +
                               "\n  # of Classes: %d\n\n",
                              super.toString(),
                              degreeSought.name(),
                              overallGpa,
                              numberOfClasses
                            );
    }//personDetails()

    /**
     * A subject a student should learn
     * @param subject   The subject
     * @return          The required string
     */
    public String learn (School.Subject subject) {
        return String.format("\nStudent:\n  %s\n  Subject: %s GPA: %.2f\n",
                              super.toString(),
                              subject.name(), overallGpa
                            );
    }//learn(Subject)

    /**
     * A subject a student should learn
     * @param subject   The subject
     * @param score     The score
     * @return          The required string
     */
    public String learn (School.Subject subject, double score) {
        return String.format("\nStudent:\n  %s\n  Degree: %s Subject: %s Score: %.2f\n",
                              super.toString(), 
                              degreeSought.name(),
                              subject.name(), score
                            );
    }//learn(Subject,double)


//OVERRIDDEN METHODS

    /**
     * A detailed list of student attibutes
     * @return  A formatted string of student attributes
     */
    @Override
    public String toString () {
        return personDetails();
    }//toString()

}//Student Class

